<template>
	<view class="wrap flex column align-center just-between">
		<view class="flex column align-center">
			<image class="success" :src="$staticImagePath('publish/success.png')" />

			<view class="title f-30">{{ title }}成功</view>

			<view class="tips f-34" v-if="type === 'article'">
				您想让你的信息让人帮你转发，快速传遍全城吗？试试百焕推广功能吧！
			</view>
		</view>

		<view class="wrap-bottom-btn-bg flex column align-center">
			<view
				class="theme-gradient-btn f-30"
				v-if="type === 'article'"
				@click="$jump.to(`/pages/home/article/publishList`)"
			>
				去推广
			</view>
			
			<view
				class="theme-gradient-btn f-30"
				v-if="type === 'redBag' || type === 'coupon'"
				@click="$jump.to(`/pages/publish/publishTop/publishTop?id=${this.article_id}`)"
			>
				去置顶
			</view>

			<view class="theme-gradient-btn f-30" v-if="type === 'recharge'" @click="$jump.to(`/pages/mine/wallet/wallet`)">
				查看钱包
			</view>

			<view class="theme-gradient-btn f-30" v-if="type === 'pay'" @click="$jump.to(`/pages/tabBar/mine`)">
				用户中心
			</view>

			<view
				class="theme-gradient-btn f-30"
				v-if="type === 'comment'"
				@click="$jump.to(`/pages/user/comment/comment`)"
			>
				查看评论
			</view>

			<view
				class="theme-gradient-btn f-30"
				v-if="type === 'feedback'"
				@click="$jump.to(`/pages/user/feedback/lists`)"
			>
				查看反馈
			</view>

			<view
				class="theme-gradient-btn f-30"
				v-if="type === 'complaint'"
				@click="$jump.to(`/pages/user/complaint/lists`)"
			>
				查看举报
			</view>

			<view class="theme-gradient-btn f-30" v-if="type === 'withdraw'" @click="$jump.to(`/pages/mine/wallet/withdrawRecords`)">
				查看提现列表
			</view>

			<view class="theme-gradient-btn f-30" v-if="type === 'find'" @click="$jump.to(`/pages/apps/find/user`)">
				查看创作中心
			</view>

			<view class="wrap-mini-btn flex align-center" @click="$jump.to('/pages/tabBar/home')">
				<text class="f-28">返回首页</text>

				<image class="arrow" :src="$staticImagePath('publish/arrow_right.png')" />
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: "",
				title: "",
				article_id: "",
			};
		},
		onLoad(options) {
			if (options.article_id) {
				this.article_id = options.article_id;
			}
			var title = "";
			if (options.type == "pay") {
				title = "支付";
			} else if (options.type == "comment") {
				title = "评论";
			} else if (options.type == "feedback") {
				title = "反馈";
			} else if (options.type == "withdraw") {
				title = "请等待后台审核，提交";
			} else if (options.type === "recharge") {
				title = "充值";
			} else if (options.type == "complaint") {
				title = "举报";
			} else if (options.type == "find") {
				title = "作品上传";
			} else if (options.type === "article") {
				title = "信息上传";
			} else if (options.type === "redBag") {
				title = "发布红包";
			} else if (options.type === "coupon") {
				title = "发布优惠券"
			} else if (options.type === "top") {
				title = "置顶"
			}
			this.title = title;
			uni.setNavigationBarTitle({ title: `${title}完成` });

			this.type = options.type;
		},
		methods: {
			/**
			 * 跳转
			 */
			onGo(url) {
				this.$jump.to(url, "redirectTo");
			},
		},
	};
</script>

<style lang="scss" scoped>
	.wrap {
		padding: 100rpx 70rpx 150rpx 70rpx;
		height: 100vh;
		box-sizing: border-box;

		> view {
			width: 100%;
			overflow: hidden;
		}

		.success {
			width: 128rpx;
			height: 128rpx;
		}

		.title {
			margin-top: 30rpx;
			color: #121212;
		}

		.tips {
			margin-top: 88rpx;
			color: #666666;
			text-align: center;
			line-height: 48rpx;
		}
	}
</style>
